//
//  TMGFlowGodlRecrdTableViewCell.m
//  TMGold
//
//  Created by Mac on 2018/3/17.
//  Copyright © 2018年 tangmu. All rights reserved.
//

#import "TMGFlowGodlRecrdTableViewCell.h"
@interface  TMGFlowGodlRecrdTableViewCell()
@property(nonatomic, strong) STLabel                     *rateLable;
@property(nonatomic, strong) STLabel                     *moneyLable;
@property(nonatomic, strong) STLabel                     *desLable;
@property(nonatomic, strong) STLabel                     *stateLable;
@end
@implementation TMGFlowGodlRecrdTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 100;
}
#pragma mark --subView
- (void)configSubView{
    self.backgroundColor = [UIColor clearColor];
    UIView * whitView = [[UIView alloc] initWithFrame:CGRectMake(15, 10, UIScreenWidth - 30, 80)];
    whitView.backgroundColor = [UIColor whiteColor];
    whitView.layer.cornerRadius = 10;
    whitView.clipsToBounds = YES;
    [self addSubview:whitView];
    
    self.rateLable = [[STLabel alloc] initWithFrame:CGRectMake(0, 0, whitView.width / 2, 40)
                                                     text:@"0.02%"
                                                textColor:TM_orangeColor
                                                     font:14
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentCenter];
    [whitView addSubview:self.rateLable];
    
    
    self.moneyLable = [[STLabel alloc] initWithFrame:CGRectMake(whitView.width / 2, 0, whitView.width / 2, 40)
                                               text:@"￥1221"
                                          textColor:TM_orangeColor
                                               font:14
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentCenter];
    [whitView addSubview:self.moneyLable];
    
    
    self.desLable = [[STLabel alloc] initWithFrame:CGRectMake(0, 40, whitView.width / 2, 40)
                                               text:@"预计黄金收益率"
                                          textColor:SecendTextColor
                                               font:14
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentCenter];
    [whitView addSubview:self.desLable];
    
    
    self.stateLable = [[STLabel alloc] initWithFrame:CGRectMake(whitView.width / 2, 40, whitView.width / 2, 40)
                                                text:@"再投"
                                           textColor:SecendTextColor
                                                font:14
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentCenter];
    [whitView addSubview:self.stateLable];
}
- (void)setModel:(TMGBuyGoldRecordModel *)model{
    _model = model;
    self.rateLable.text = [NSString stringWithFormat:@"%@%@",model.year_rate,@"%"];
    self.moneyLable.text = [NSString stringWithFormat:@"%@%@",@"￥",model.now_price];
    if (model.is_on.integerValue == 1) {
        self.stateLable.text = @"在投";
    }else{
        self.stateLable.text = @"到期";
    }
}
@end
